module Entities
  class User < Grape::Entity
    <%_ if (swagger) { -%>
    expose :id, documentation: { type: 'integer', desc: '用户 id' }
    expose :name, documentation: { type: 'string', desc: '姓名' }
    expose :age, documentation: { type: 'integer', desc: '年龄' }
    <%_ } else { -%>
    expose :id
    expose :name
    expose :age
    <%_ } -%>
  end
end
